﻿using System;
using System.Collections.Generic;
using System.IO;

namespace Studio
{
	// Token: 0x020004A3 RID: 1187
	public class OIFolderInfo : ObjectInfo
	{
		// Token: 0x06001D9D RID: 7581 RVA: 0x000BBF58 File Offset: 0x000BA158
		public OIFolderInfo(int _key) : base(_key)
		{
			this.name = "フォルダー";
			this.child = new List<ObjectInfo>();
		}

		// Token: 0x17000322 RID: 802
		// (get) Token: 0x06001D9E RID: 7582 RVA: 0x000BBF84 File Offset: 0x000BA184
		public override int kind
		{
			get
			{
				return 3;
			}
		}

		// Token: 0x17000323 RID: 803
		// (get) Token: 0x06001D9F RID: 7583 RVA: 0x000BBF88 File Offset: 0x000BA188
		// (set) Token: 0x06001DA0 RID: 7584 RVA: 0x000BBF90 File Offset: 0x000BA190
		public List<ObjectInfo> child { get; private set; }

		// Token: 0x06001DA1 RID: 7585 RVA: 0x000BBF9C File Offset: 0x000BA19C
		public override void Save(BinaryWriter _writer, Version _version)
		{
			base.Save(_writer, _version);
			_writer.Write(this.name);
			int count = this.child.Count;
			_writer.Write(count);
			for (int i = 0; i < count; i++)
			{
				this.child[i].Save(_writer, _version);
			}
		}

		// Token: 0x06001DA2 RID: 7586 RVA: 0x000BBFF8 File Offset: 0x000BA1F8
		public override void Load(BinaryReader _reader, Version _version, bool _import, bool _tree = true)
		{
			base.Load(_reader, _version, _import, true);
			this.name = _reader.ReadString();
			ObjectInfoAssist.LoadChild(_reader, _version, this.child, _import);
		}

		// Token: 0x06001DA3 RID: 7587 RVA: 0x000BC020 File Offset: 0x000BA220
		public override void DeleteKey()
		{
			Studio.DeleteIndex(base.dicKey);
			foreach (ObjectInfo objectInfo in this.child)
			{
				objectInfo.DeleteKey();
			}
		}

		// Token: 0x0400202D RID: 8237
		public string name = string.Empty;
	}
}
